package com.xxmw.transaction.common.excep;

import com.xxmw.transaction.common.entity.R;
import com.xxmw.transaction.common.excep.service.TransactionException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author luowenliang
 * @since 2020/2/11 13:57
 */
@RestControllerAdvice
public class TransactionExceptionHandler extends GlobExceptionHandler {

    @ExceptionHandler(TransactionException.class)
    public R transactionAdminException(TransactionException e){
        return R.error(e.getCode(), e.getMessage());
    }
}
